﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
namespace DAL
{
    public class sp_user_cartDAL
    {
        MyShoppingDB_VueEntities nn = new MyShoppingDB_VueEntities();
        public List<sp_user_cart> cx()
        {
            return nn.Set<sp_user_cart>().ToList();
        }
        public int tj(sp_user_cart dx)
        {
            nn.Set<sp_user_cart>().Add(dx);
            return nn.SaveChanges();
        }
        public int xg(sp_user_cart dx)
        {
            sp_user_cart kk=  nn.sp_user_cart.Find(dx.cart_id);
            kk.cart_info = dx.cart_info;
            kk.user_id = dx.user_id;
            kk.created_at = dx.created_at;
            kk.updated_at = dx.updated_at;
            kk.delete_time = dx.delete_time;
            return nn.SaveChanges();
        }
    }
    }

